package control
{
	import com.google.maps.MapEvent;
	import com.google.maps.PaneId;
	import com.google.maps.interfaces.IMap;
	import com.google.maps.interfaces.IPane;
	
	import flash.display.Shape;
	import flash.geom.Point;

	/**
	 * Simple line class,use array draw line
	 */
	public class SimpleLine extends SimpleShape
	{
		
		
		public function SimpleLine(latlngs:Array,option:DrawOptions = null)
		{
			super();
			this.cloud = new Shape();
			this.latlngs = latlngs;
			this.addChild(cloud);
			if(option != null)
				this.option = option;
		
		}
		
		protected override function draw():void
		{
			this.cloud.graphics.clear();
			
			cloud.graphics.lineStyle(option.lineWidth,option.fillColor,option.ancho);
			
			
			var point1:Point = this.pane.fromLatLngToPaneCoords(this.latlngs[0]);
			var point2:Point = this.pane.fromLatLngToPaneCoords(this.latlngs[1]);
			
			
			cloud.graphics.moveTo(point1.x,point1.y);
			cloud.graphics.lineTo(point2.x,point2.y);
		}

	}
}
